package org.corey.wyp.vo
{
	import org.corey.wyp.utils.Calculator;
	
	[Bindable]
	[RemoteClass(alias="org.corey.wyp.vo.MonthSetting")]
	public class MonthSetting
	{	
		public var id:int;
		public var year:int;
		public var month:int;
		public var monthIncoming:Number=0;
		public var roomOut:Number=0;
		public var foodFund:Number=0;
		public var funFund:Number=0;
		public var trafficFund:Number=0;
		public var livingFund:Number=0;
		public var wearFund:Number=0;
		public var daySetting:DaySetting=new DaySetting();
	
		public function MonthSetting()
		{
		}
		
		public function get foodLimitTotal():Number{
			var foodLimitTotal:Number=Calculator.calculate(year,month,daySetting.foodLimit);
			return foodLimitTotal;
		}
		
		public function get trafficLimitTotal():Number{
			var trafficLimitTotal:Number=Calculator.calculate(year,month,daySetting.trafficLimit);
			return trafficLimitTotal;
		}
		
		public function get sockLimitTotal():Number{
			var sockLimitTotal:Number=Calculator.calculate(year,month,daySetting.sockLimit);
			return sockLimitTotal;
		}
		
		public function get fruitLimitTotal():Number{
			var fruitLimitTotal:Number=Calculator.calculate(year,month,daySetting.fruitLimit);
			return fruitLimitTotal;
		}
		
		public function get otherLimitTotal():Number{
			var otherLimitTotal:Number=Calculator.calculate(year,month,daySetting.otherLimit);
			return otherLimitTotal;
		}
		
		public function get balance():Number{
			return monthIncoming-roomOut-foodFund-funFund-livingFund-trafficFund-wearFund-foodLimitTotal-fruitLimitTotal-sockLimitTotal-otherLimitTotal-trafficFund;
		}

	}
}